-------------------------------------------------------------------------------
      name:  <unnamed>
       log:  cbs0208.out
  log type:  text
 opened on:  30 Apr 2015, 16:09:15

.  set more off;

. /* input data from full CBS News data 
> 
> use 26143-0001-Data; */
> 
> /* read subset of CBS News Data */
> 
> insheet using cbs0208.csv, comma names case;
(8 vars, 1266 obs)

.  /* create various party id variables */
> 
> gen partyid3=2 if PRTY==1;
(884 missing values generated)

. replace partyid3=0 if PRTY==2;
(464 real changes made)

. replace partyid3=1 if PRTY==3;
(364 real changes made)

. gen rep=(PRTY==1) if PRTY<4;
(56 missing values generated)

. gen dem=(PRTY==2) if PRTY<4;
(56 missing values generated)

. gen ind=(PRTY==3) if PRTY<4;
(56 missing values generated)

. /* create overall bush approval */
> 
> gen bushappr=(Q1==1) if Q1==1 | Q1==2;
(96 missing values generated)

. /* create bush policy area approval */
> 
> gen busecon=(Q3==1) if Q3==1 | Q3==2;
(127 missing values generated)

. gen busiraq=(Q4==1) if Q4==1 | Q4==2;
(67 missing values generated)

. /* Table A.20 in appendix */
> 
> logit bushappr busecon busiraq dem rep [pweight=WGHT];

Iteration 0:   log pseudolikelihood = -612.48455  
Iteration 1:   log pseudolikelihood = -217.47742  
Iteration 2:   log pseudolikelihood = -194.74172  
Iteration 3:   log pseudolikelihood = -192.97222  
Iteration 4:   log pseudolikelihood = -192.96745  
Iteration 5:   log pseudolikelihood = -192.96745  

Logistic regression                               Number of obs   =       1010
                                                  Wald chi2(4)    =     254.29
                                                  Prob > chi2     =     0.0000
Log pseudolikelihood = -192.96745                 Pseudo R2       =     0.6849

------------------------------------------------------------------------------
             |               Robust
    bushappr |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     busecon |   2.474514   .3486964     7.10   0.000     1.791081    3.157946
     busiraq |   3.495952   .3531282     9.90   0.000     2.803833    4.188071
         dem |  -1.646703   .4632953    -3.55   0.000    -2.554745   -.7386611
         rep |   1.061301   .4121094     2.58   0.010     .2535812     1.86902
       _cons |  -3.082487   .3914035    -7.88   0.000    -3.849624   -2.315351
------------------------------------------------------------------------------

. /* rate national economy */
> 
> gen econcond=5-Q6 if Q6<9;
(16 missing values generated)

. /* rate change in national economy */
> 
> gen natecon=3 if Q7==1;
(1221 missing values generated)

. replace natecon=2 if Q7==3;
(412 real changes made)

. replace natecon=1 if Q7==2;
(796 real changes made)

. /* rate progress of war in Iraq */
> 
> gen iraqprog=5-Q77 if Q77<9;
(46 missing values generated)

. /* show factors influencing overall approval (Table A.20 in appendix) */
> 
> logit bushappr econcond iraqprog dem rep [pweight=WGHT];

Iteration 0:   log pseudolikelihood = -684.79904  
Iteration 1:   log pseudolikelihood = -387.52391  
Iteration 2:   log pseudolikelihood = -359.65255  
Iteration 3:   log pseudolikelihood =  -358.2368  
Iteration 4:   log pseudolikelihood = -358.23539  
Iteration 5:   log pseudolikelihood = -358.23539  

Logistic regression                               Number of obs   =       1082
                                                  Wald chi2(4)    =     168.47
                                                  Prob > chi2     =     0.0000
Log pseudolikelihood = -358.23539                 Pseudo R2       =     0.4769

------------------------------------------------------------------------------
             |               Robust
    bushappr |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    econcond |   1.125771   .2105287     5.35   0.000     .7131419    1.538399
    iraqprog |   1.240473   .1808003     6.86   0.000      .886111    1.594835
         dem |  -1.899315   .3679324    -5.16   0.000     -2.62045   -1.178181
         rep |   1.153055   .2820195     4.09   0.000     .6003067    1.705803
       _cons |  -6.157665   .6442023    -9.56   0.000    -7.420278   -4.895051
------------------------------------------------------------------------------

. logit bushappr natecon iraqprog dem rep [pweight=WGHT];

Iteration 0:   log pseudolikelihood = -685.27228  
Iteration 1:   log pseudolikelihood = -401.42176  
Iteration 2:   log pseudolikelihood = -376.32079  
Iteration 3:   log pseudolikelihood = -374.89147  
Iteration 4:   log pseudolikelihood = -374.88896  
Iteration 5:   log pseudolikelihood = -374.88896  

Logistic regression                               Number of obs   =       1085
                                                  Wald chi2(4)    =     158.36
                                                  Prob > chi2     =     0.0000
Log pseudolikelihood = -374.88896                 Pseudo R2       =     0.4529

------------------------------------------------------------------------------
             |               Robust
    bushappr |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     natecon |   .8552039   .2218543     3.85   0.000     .4203774     1.29003
    iraqprog |   1.379074   .1778547     7.75   0.000     1.030485    1.727663
         dem |   -1.98323   .3853203    -5.15   0.000    -2.738444   -1.228016
         rep |   1.252476   .2789306     4.49   0.000     .7057818     1.79917
       _cons |  -5.296366   .5383601    -9.84   0.000    -6.351533     -4.2412
------------------------------------------------------------------------------

. /* create subset of CBS News poll data */
> 
> /* outsheet WGHT PRTY Q1 Q3 Q4 Q6 Q7 Q77 using cbs0208.csv, comma
> nolabel replace; */
> 
> log close;
      name:  <unnamed>
       log:  cbs0208.out
  log type:  text
 closed on:  30 Apr 2015, 16:09:15
-------------------------------------------------------------------------------
